package object;

class Person extends Object{
	String name;
	int age;
	
	//一般情况不想看对象地址，看对象的属性，
	//就要重写toString()方法，把要看的属性选择上
	@Override
	public String toString() {
		return "Person [name=" + name + ", age=" + age + "]";
	}
}

public class PersonDemo {
	public static void main(String[] args) {
		Person p = new Person();
		p.name = "张三";
		p.age = 10;
		
		// object.Person@15db9742
		System.out.println(p);
		System.out.println(p.toString());
	}
}
